/*******************************************************************************
 * Size: 24 px
 * Bpp: 4
 * Opts: 
 ******************************************************************************/

#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif

#ifndef POP_CAT_APP_FONT_24
#define POP_CAT_APP_FONT_24 1
#endif

#if POP_CAT_APP_FONT_24

/*-----------------
 *    BITMAPS
 *----------------*/

/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
    /* U+004F "O" */
    0x0, 0x0, 0x39, 0xdf, 0xfe, 0xb5, 0x0, 0x0,
    0x0, 0x0, 0x9f, 0xff, 0xff, 0xff, 0xfd, 0x20,
    0x0, 0x0, 0xbf, 0xfd, 0x63, 0x35, 0xbf, 0xff,
    0x30, 0x0, 0x8f, 0xfa, 0x0, 0x0, 0x0, 0x5f,
    0xfd, 0x0, 0x2f, 0xfd, 0x0, 0x0, 0x0, 0x0,
    0x7f, 0xf8, 0x8, 0xff, 0x50, 0x0, 0x0, 0x0,
    0x0, 0xef, 0xe0, 0xcf, 0xf0, 0x0, 0x0, 0x0,
    0x0, 0x9, 0xff, 0x2e, 0xfd, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x7f, 0xf4, 0xff, 0xc0, 0x0, 0x0,
    0x0, 0x0, 0x6, 0xff, 0x5e, 0xfd, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x7f, 0xf5, 0xcf, 0xf0, 0x0,
    0x0, 0x0, 0x0, 0x9, 0xff, 0x28, 0xff, 0x50,
    0x0, 0x0, 0x0, 0x0, 0xef, 0xe0, 0x2f, 0xfd,
    0x0, 0x0, 0x0, 0x0, 0x7f, 0xf8, 0x0, 0x8f,
    0xfa, 0x0, 0x0, 0x0, 0x5f, 0xfd, 0x0, 0x0,
    0xcf, 0xfd, 0x63, 0x25, 0xaf, 0xff, 0x30, 0x0,
    0x0, 0x9f, 0xff, 0xff, 0xff, 0xfd, 0x20, 0x0,
    0x0, 0x0, 0x39, 0xdf, 0xfe, 0xb5, 0x0, 0x0,
    0x0,

    /* U+0050 "P" */
    0x6f, 0xff, 0xff, 0xfe, 0xc7, 0x10, 0x6, 0xff,
    0xff, 0xff, 0xff, 0xfe, 0x40, 0x6f, 0xf4, 0x11,
    0x13, 0x8f, 0xff, 0x26, 0xff, 0x30, 0x0, 0x0,
    0x4f, 0xf9, 0x6f, 0xf3, 0x0, 0x0, 0x0, 0xef,
    0xd6, 0xff, 0x30, 0x0, 0x0, 0xd, 0xfd, 0x6f,
    0xf3, 0x0, 0x0, 0x3, 0xff, 0xa6, 0xff, 0x30,
    0x0, 0x27, 0xef, 0xf3, 0x6f, 0xff, 0xff, 0xff,
    0xff, 0xf5, 0x6, 0xff, 0xff, 0xff, 0xfe, 0x92,
    0x0, 0x6f, 0xf4, 0x11, 0x10, 0x0, 0x0, 0x6,
    0xff, 0x30, 0x0, 0x0, 0x0, 0x0, 0x6f, 0xf3,
    0x0, 0x0, 0x0, 0x0, 0x6, 0xff, 0x30, 0x0,
    0x0, 0x0, 0x0, 0x6f, 0xf3, 0x0, 0x0, 0x0,
    0x0, 0x6, 0xff, 0x30, 0x0, 0x0, 0x0, 0x0,
    0x6f, 0xf3, 0x0, 0x0, 0x0, 0x0, 0x0,

    /* U+732B "猫" */
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x59, 0x0, 0x3,
    0x20, 0x4, 0xff, 0x0, 0x7, 0xf9, 0x0, 0x0,
    0x1, 0xff, 0x50, 0x1e, 0xe1, 0x4, 0xff, 0x0,
    0x7, 0xf9, 0x0, 0x0, 0x0, 0x7f, 0xe1, 0xcf,
    0xe8, 0x8a, 0xff, 0x88, 0x8b, 0xfc, 0x88, 0x81,
    0x0, 0xe, 0xfe, 0xfd, 0x7f, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xf3, 0x0, 0x6, 0xff, 0xe2,
    0x38, 0x8a, 0xff, 0x88, 0x8b, 0xfc, 0x88, 0x81,
    0x0, 0x2d, 0xff, 0x60, 0x0, 0x4, 0xff, 0x0,
    0x7, 0xf9, 0x0, 0x0, 0x4, 0xef, 0xff, 0xa0,
    0x0, 0x4, 0xee, 0x0, 0x6, 0xe8, 0x0, 0x0,
    0x1f, 0xfe, 0x5f, 0xe0, 0x3, 0x44, 0x44, 0x44,
    0x44, 0x44, 0x43, 0x0, 0x7, 0xc1, 0xe, 0xf2,
    0xb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0,
    0x0, 0x0, 0xd, 0xf5, 0xb, 0xfe, 0xdd, 0xdf,
    0xfd, 0xdd, 0xfe, 0x0, 0x0, 0x0, 0x9f, 0xf7,
    0xb, 0xf4, 0x0, 0x2f, 0xd0, 0x1, 0xfe, 0x0,
    0x0, 0x6, 0xff, 0xf9, 0xb, 0xf4, 0x0, 0x2f,
    0xd0, 0x1, 0xfe, 0x0, 0x0, 0x5f, 0xfa, 0xfa,
    0xb, 0xf4, 0x0, 0x2f, 0xd0, 0x1, 0xfe, 0x0,
    0x6, 0xff, 0x84, 0xfb, 0xb, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xfe, 0x0, 0x1f, 0xfa, 0x4, 0xfc,
    0xb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0,
    0x6, 0xa0, 0x4, 0xfc, 0xb, 0xf6, 0x22, 0x4f,
    0xe2, 0x24, 0xfe, 0x0, 0x0, 0x0, 0x4, 0xfd,
    0xb, 0xf4, 0x0, 0x2f, 0xd0, 0x1, 0xfe, 0x0,
    0x0, 0x0, 0x5, 0xfc, 0xb, 0xf4, 0x0, 0x2f,
    0xd0, 0x1, 0xfe, 0x0, 0x0, 0x0, 0x6, 0xfc,
    0xb, 0xf4, 0x0, 0x2f, 0xd0, 0x1, 0xfe, 0x0,
    0x0, 0x33, 0x4c, 0xfa, 0xb, 0xf6, 0x22, 0x4f,
    0xe2, 0x23, 0xfe, 0x0, 0x0, 0xdf, 0xff, 0xf5,
    0xb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0,
    0x0, 0xaf, 0xeb, 0x60, 0xb, 0xff, 0xff, 0xff,
    0xff, 0xff, 0xfe, 0x0, 0x0, 0x0, 0x0, 0x0,
    0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
};


/*---------------------
 *  GLYPH DESCRIPTION
 *--------------------*/

static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
    {.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
    {.bitmap_index = 0, .adv_w = 294, .box_w = 17, .box_h = 17, .ofs_x = 1, .ofs_y = 1},
    {.bitmap_index = 145, .adv_w = 233, .box_w = 13, .box_h = 17, .ofs_x = 1, .ofs_y = 1},
    {.bitmap_index = 256, .adv_w = 384, .box_w = 24, .box_h = 24, .ofs_x = 0, .ofs_y = -3}
};

/*---------------------
 *  CHARACTER MAPPING
 *--------------------*/

static const uint16_t unicode_list_0[] = {
    0x0, 0x1, 0x72dc
};

/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
    {
        .range_start = 79, .range_length = 29405, .glyph_id_start = 1,
        .unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 3, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
    }
};

/*-----------------
 *    KERNING
 *----------------*/


/*Pair left and right glyphs for kerning*/
static const uint8_t kern_pair_glyph_ids[] =
{
    2, 1
};

/* Kerning between the respective left and right glyphs
 * 4.4 format which needs to scaled with `kern_scale`*/
static const int8_t kern_pair_values[] =
{
    1
};

/*Collect the kern pair's data in one place*/
static const lv_font_fmt_txt_kern_pair_t kern_pairs =
{
    .glyph_ids = kern_pair_glyph_ids,
    .values = kern_pair_values,
    .pair_cnt = 1,
    .glyph_ids_size = 0
};

/*--------------------
 *  ALL CUSTOM DATA
 *--------------------*/

#if LV_VERSION_CHECK(8, 0, 0)
/*Store all the custom data of the font*/
static  lv_font_fmt_txt_glyph_cache_t cache;
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
    .glyph_bitmap = glyph_bitmap,
    .glyph_dsc = glyph_dsc,
    .cmaps = cmaps,
    .kern_dsc = &kern_pairs,
    .kern_scale = 16,
    .cmap_num = 1,
    .bpp = 4,
    .kern_classes = 0,
    .bitmap_format = 0,
#if LV_VERSION_CHECK(8, 0, 0)
    .cache = &cache
#endif
};


/*-----------------
 *  PUBLIC FONT
 *----------------*/

/*Initialize a public general font descriptor*/
#if LV_VERSION_CHECK(8, 0, 0)
const lv_font_t pop_cat_app_font_24 = {
#else
lv_font_t pop_cat_app_font_24 = {
#endif
    .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt,    /*Function pointer to get glyph's data*/
    .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt,    /*Function pointer to get glyph's bitmap*/
    .line_height = 24,          /*The maximum line height required by the font*/
    .base_line = 3,             /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
    .subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
    .underline_position = -2,
    .underline_thickness = 1,
#endif
    .dsc = &font_dsc           /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
};



#endif /*#if POP_CAT_APP_FONT_24*/

